package com.lml.yunpicturesbackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lml.yunpicturesbackend.model.dto.user.UserQueryRequest;
import com.lml.yunpicturesbackend.model.entity.User;
import com.lml.yunpicturesbackend.model.vo.LoginUserVo;
import com.lml.yunpicturesbackend.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author 梦龙
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2025-04-04 21:51:42
 */
public interface UserService extends IService<User> {

    // 用户注册
    long userRegister(String userAccount, String userPassword, String checkPassword);

    // 获取加密后的密码
    String getEncryptPassword(String userPassword);

    // 脱敏后的用户信息
    LoginUserVo userLogin(String userAccount, String userPassword, HttpServletRequest httpServerRequest);

    // 获得脱敏后的用户登陆信息
    LoginUserVo getLoginUserVO(User user);

    // 获得脱敏后的用户信息
    UserVO getUserVO(User user);

    // 获得脱敏后的用户信息列表
    List<UserVO> getUserVOList(List<User> userList);

    // 获取当前登录用户
    User getLoginUser(HttpServletRequest request);

    // 用户登出
    Boolean userLogout(HttpServletRequest request);

    // 获取查询条件
    QueryWrapper<User> getQueryWrapper (UserQueryRequest userQueryRequest);

    // 判断是否为管理员
    boolean isAdmin(User user);
}
